<template>
  <div class="container">
    <div class="left-panel">
      <h3>证件照片</h3>
      <div class="id-photo-container">
        <img v-for="(photo, index) in idPhotos" :key="index" :src="photo" class="id-photo" />
      </div>

      <div class="info-wrapper">
        <div class="info-container">
          <div class="info-item">
            <span class="info-label">证件姓名</span>
            <span class="info-value">艾薇儿</span>
            <div class="divider"></div>
          </div>

          <div class="info-item">
            <span class="info-label">证件号码</span>
            <span class="info-value">460051990110253321</span>
            <div class="divider"></div>
          </div>

          <div class="info-item">
            <span class="info-label">有效期至</span>
            <span class="info-value">20291125</span>
            <div class="divider"></div>
          </div>

          <div class="id-requirements">
            <p><span class="info-label">身份证照片要求:</span></p>
            <p class="grey-text">请持本人有效二代身份证；</p>
            <p>
              <span class="grey-text">拍摄时确保身份证</span>
              <span class="highlight">边框完整，字体清晰，亮度均匀；</span>
            </p>
          </div>

          <div class="example-photos">
            <div v-for="(example, index) in examples" :key="index" class="example-photo">
              <div class="image-container">
                <img :src="example.image" :class="{ 'good-example': example.good }" />
              </div>
              <span :class="{ 'good-label': example.good }">{{ example.label }}</span>
            </div>
          </div>
        </div>
      </div>

      <el-button type="primary" class="confirm-button">确认</el-button>
    </div>

    <div class="right-panel">
      <div class="user-info">
        <img src="imgs/mwzz.png" class="user-avatar" />
        <div class="user-name">艾薇儿 <el-tag size="mini">未实名</el-tag></div>
      </div>
      <div class="button-container">
      <el-button type="primary" class="action-button">我的简历</el-button>
      <el-button class="action-button">我的招聘</el-button>
    </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      idPhotos: [
        'imgs/mwzz.png',
        'imgs/mwzz.png'
      ],
      examples: [
        { image: 'imgs/mwzz.png', good: true, label: '标准' },
        { image: 'imgs/mwzz.png', good: false, label: '边框缺失' },
        { image: 'imgs/mwzz.png', good: false, label: '照片模糊' },
        { image: 'imgs/mwzz.png', good: false, label: '闪光强烈' }
      ]
    }
  }
}
</script>

<style scoped>
.container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
  background-color: #f5f7fa;
  min-height: 100vh;
}

.left-panel {
  background: linear-gradient(to bottom, #f0f0f0 50%, white 50%); /* 上下灰白两色 */
  background-size: 100% 50%; /* 调整比例 */
  background-repeat: no-repeat;
  background-color: white;
  padding: 20px;
  border-radius: 4px;
  width: 60%;
  margin-right: 20px;
  text-align: center; /* 居中 */
}

.info-wrapper {
  display: flex;
  justify-content: center;
}

.info-container {
  display: inline-block; /* 保持内层内容左对齐 */
  text-align: left;
  width: 40%; /* 控制内容宽度 */
}

.id-photo-container {
  display: flex;
  justify-content: center; /* 证件照居中 */
  gap: 10px;
  margin-bottom: 20px;
}

.id-photo {
  width: 200px;
  height: 130px;
  border: 1px solid #ebeef5;
  object-fit: cover; /* 确保图片适应容器 */
}

.info-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 30px; /* 减小间距 */
  position: relative;
}

.info-label {
  margin-right: 10px;
  white-space: nowrap; /* 防止换行 */
}

.info-value {
  flex-grow: 1;
  text-decoration: none; /* 取消下划线 */
}

.divider {
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: #e0e0e0; /* 分割线颜色 */
}

.id-requirements {
  margin-top: 20px;
  text-align: left; /* 确保要求文本左对齐 */
}

.grey-text {
  color: #909399; /* 浅灰色 */
}

.highlight {
  color: red; /* 标红文本 */
}

.example-photos {
  background-color: #fff;
  border: 1px solid #ebeef5;
  border-radius: 4px;
  padding: 15px;
  margin-top: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 添加阴影效果 */
  position: relative;
  display: flex;
  flex-wrap: nowrap; /* 允许换行 */
  overflow-x: auto; /* 允许水平滚动 */
  gap: 15px; /* 添加间距 */
  justify-content: center; /* 居中内容 */
}

.example-photos::before {
  content: "拍照示例";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #fff;
  color: #909399; /* 浅灰色 */
  font-size: 12px;
  padding: 0 5px;
  border: 1px solid #ebeef5;
  border-radius: 2px;
}

.example-photos {
  display: flex;
  gap: 10px;
  margin-top: 20%;
  justify-content: flex-start; /* 确保示例照片左对齐 */
}

.example-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 20%; /* 设置宽度为20%，可以根据需要调整 */
  min-width: 100px; /* 设置最小宽度 */
}

.image-container {
  width: 80px;
  height: 50px;
  overflow: hidden; /* 确保图片不溢出 */
  margin-bottom: 5px;
}

.example-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 确保图片适应容器 */
}

.good-example {
  border: 2px solid #67c23a !important;
}

.good-label {
  color: #67c23a;
}

.confirm-button {
  width: 40%;
  margin-top: 20px;
}

.right-panel {
  background-color: white;
  padding: 20px;
  border-radius: 4px;
  width: 15%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

.user-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-bottom: 10px;
}

.user-name {
  font-size: 18px;
  font-weight: bold;
}

.button-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px; /* 按钮之间的间距 */
  width: 100%;
}

.action-button {
  width: 100%;
  margin-bottom: 10px;
}
</style>